package com.legendshop.openportal.sdk.model.request;

import com.legendshop.openportal.sdk.annotation.EnumValid;
import com.legendshop.openportal.sdk.model.BaseRequest;
import com.legendshop.openportal.sdk.model.constants.PaymentTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import static com.legendshop.openportal.sdk.model.constants.ApiPathConstants.CONFIRM_ORDER;

/**
 * @author jzh
 * @version 1.0.0
 * @title OrderConfirmRequest
 * @date 2024/6/26 14:24
 * @description：订单确认请求
 */
@Data
@ApiModel("订单确认请求")
public class OrderConfirmRequest extends BaseRequest {

    private static final long serialVersionUID = -626745417104692559L;

    /**
     * 非空：是
     * 订单号(下单返回的父订单号)
     */
    @ApiModelProperty("订单号")
    @NotBlank(message = "订单号不能为空")
    private String subNumber;

    /**
     * 非空：是
     * 支付方式枚举值
     * 1：预存款
     * 2：授信
     */
    @ApiModelProperty(value = "支付方式", example = "1：预存款  2：授信")
    @EnumValid(target = PaymentTypeEnum.class, message = "支付方式类型不匹配")
    @NotNull(message = "支付方式不能为空")
    private Integer paymentType;

    @Override
    @ApiModelProperty(hidden = true)
    public String getApiPath() {
        return CONFIRM_ORDER;
    }
}
